package com.lunatic.enumdemo;

import lombok.Data;

import java.util.EnumSet;

@Data
public class Pizza002 {
    private static EnumSet<PizzaStatus> pizzaStatusEnumSet = EnumSet.of(PizzaStatus.ORDERED, PizzaStatus.READY);
    private PizzaStatus status;

    public boolean isDeliver() {
        return this.status.isDelivered();
    }

    public enum PizzaStatus {
        ORDERED(5) {
            @Override
            public boolean isOrdered() {
                return true;
            }
        },
        READY(2) {
            @Override
            public boolean isReady() {
                return true;
            }
        },
        DELIVERED(0) {
            @Override
            public boolean isDelivered() {
                return true;
            }
        };

        private int timeToDelivery;

        PizzaStatus(int timeToDelivery) {
            this.timeToDelivery = timeToDelivery;
            System.out.println(timeToDelivery);
        }

        public boolean isOrdered() {
            return false;
        }

        public boolean isReady() {
            return false;
        }

        public boolean isDelivered() {
            return false;
        }
    }
}
